const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  publicPath: './',
  transpileDependencies: true,
  devServer: {
    proxy: {
    //这个是自己的后端请求时前缀
      "/api": {
        target: "http://wm.com", //这里填入你要请求的接口的前缀
        // ws: false, //代理websocked
        assetsSubDirectory: 'static',
        changeOrigin: true, //虚拟的站点需要更管origin
        pathRewrite: {
          "^/api": "", //重写路径
        },
      },
    },
    //port可以设定该vue项目的端口
    port: 8080,
  },
  lintOnSave: false,
  chainWebpack: (config) => {
    config.plugin('define').tap((definitions) => {
      Object.assign(definitions[0], {
        __VUE_OPTIONS_API__: 'true',
        __VUE_PROD_DEVTOOLS__: 'false',
        __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false'
      })
      return definitions
    })
  }
})
